﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
using HotChocolate;

namespace Himp.Platform.Dc;

[DependsOn(
    typeof(DcDomainModule),
    typeof(DcApplicationContractsModule),
    typeof(AbpDddApplicationModule),
    typeof(AbpAutoMapperModule)
    )]
public class DcApplicationModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        context.Services.AddGraphQLServer().AddQueryType<Query>();
        context.Services.AddAutoMapperObjectMapper<DcApplicationModule>();
        Configure<AbpAutoMapperOptions>(options =>
        {
            options.AddMaps<DcApplicationModule>(validate: false);
        });
    }
}

public class Query
{
    public string Hello() => "Hello from Hot Chocolate!";
}
